<template>
  <div class="content">
    <Air title="地产列表"></Air>
    <List :list='list'></List>
  </div>
</template>

<script>
import List from './components/List'
import {getProperties} from '@/api/properties'
export default {
  components:{
    List
    },
    data(){
      return {
        list:[]
      }
      },
      created(){
        console.log(this.$route.query)
        if(this.$route.query.agent){
          this.getProperties({agent:this.$route.query.agent})
        }
        if(this.$route.query.category){
          this.getProperties({category:this.$route.query.category})
        }
      },
      methods:{
        async getProperties(prompt){
          let {data} = await getProperties(prompt)
          console.log(data)
          this.list=data
        }
      }

}
</script>

<style>

</style>